//
// Created by 王乐 on 2022/2/9.
//

#ifndef LESTE_LEPARTICLEGAMEOBJECT_H
#define LESTE_LEPARTICLEGAMEOBJECT_H

#include "LeGameObject.h"
#include "glm/glm.hpp"
#include <string>

struct LeParticle
{
    std::string m_Name;
    float m_LiftTime;

    glm::vec3 m_StartPosition;
    float m_StartRotation;
    glm::vec3 m_StartScale;

    glm::vec3 m_Velocity;
    float m_AngularSpeed;
    float m_ScaleChangeValue;

    const char* m_SpritePath;

    float m_RValue;

    LeParticle(){}
    LeParticle(const std::string& mName, float mLiftTime, const glm::vec3 &mStartPosition, float mStartRotation, const glm::vec3 &mStartScale,
               const glm::vec3 &mVelocity, float mAngularSpeed, float mScaleChangeRatio, const char *mSpritePath);

    LeParticle(const std::string& mName, float mLiftTime, const glm::vec3 &mVelocity, float mAngularSpeed, float mScaleChangeValue,
               const char *mSpritePath);
};

class LeParticleSystem;

class LeParticleGameObject : public LeGameObject
{
public:
    LeParticleGameObject(LeParticleSystem* pParticleSystem);
    virtual ~LeParticleGameObject();

public:
    void Initialize() override;

    void InitializeParticleGameObject(const char* vertexshaderpath, const char* fragmentshaderpath,
                                      const LeParticle &particle);

    LeParticleSystem* getParticleSystem();

public:
    LeParticle m_Particle;

private:
    const char* m_VertexShaderPath;
    const char* m_FragmentShaderPath;

    LeParticleSystem* m_pParticleSystem;

};


#endif //LESTE_LEPARTICLEGAMEOBJECT_H
